package com.nnee.p_up;

import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Resources;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.NetworkInfo.State;
import android.os.Build;
import android.os.Build.VERSION;
import android.os.Bundle;
import android.os.Environment;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.widget.Toast;
import com.nnee.p_e.cls_d;
import com.nnee.p_pr.p_a.cls_i;
import com.nnee.p_pr.p_activity.cls_PRISActivityUpdate;
import com.nnee.p_pr.p_app.cls_PrisApp;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.net.SocketException;
import java.net.URLEncoder;
import java.net.UnknownHostException;
import java.security.MessageDigest;
import java.util.regex.PatternSyntaxException;
import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.StatusLine;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.params.HttpClientParams;
import org.apache.http.conn.scheme.PlainSocketFactory;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
import org.apache.http.params.HttpProtocolParams;

public class cls_c
{
  public static final int A = 1005;
  public static final int B = 1006;
  public static final int C = 1007;
  public static final int D = 1008;
  public static final int E = 1009;
  public static final int F = 1010;
  public static final int G = 1011;
  public static final int H = 1012;
  public static final int I = 1013;
  public static final int J = 1014;
  public static final int K = 1011;
  public static final int L = 1015;
  public static final int M = 1016;
  public static final int N = 1017;
  public static final int O = 1018;
  public static final int P = 1019;
  public static final int Q = 1020;
  private static final int R = 0;
  private static final int S = 1;
  private static final String T = "http://%s/au/m/update.xml";
  private static final String U = "1.0.1";
  private static final String V = "Android";
  private static final String W = "1.6Later";
  private static final String X = "*";
  private static final String Y = "*";
  private static final String Z = "cu.123.163.com";
  static final String a = "Helper";
  private static final String aa = "80";
  private static HttpClient ab;
  private static int ac = 0;
  public static final int b = 1024;
  public static final String c = "PRIS";
  public static final String d = "version";
  public static final String e = "name";
  public static final String f = "location";
  public static final String g = "size";
  public static final String h = "md5";
  public static final String i = "function";
  public static final String j = "bugfix";
  public static final String k = "others";
  public static final String l = Environment.getExternalStorageDirectory().getPath() + "/" + "pris" + "/";
  public static final String m = "download";
  public static final int n = 0;
  public static final int o = 1;
  public static final String p = "HTTP://123.163.com/stat";
  public static String q = null;
  public static String r = null;
  public static String s = null;
  public static String t = null;
  public static String u = null;
  public static String v = null;
  public static int w = 0;
  public static final int x = 0;
  public static final int y = 1000;
  public static final int z = 1004;

  static
  {
    ac = 0;
  }

  public static int a()
  {
    if (w < 3);
    try
    {
      w = Integer.parseInt(Build.VERSION.SDK);
      return w;
    }
    catch (NumberFormatException localNumberFormatException)
    {
      while (true)
      {
        w = -1;
        com.nnee.p_g.cls_b.d("Helper", "getSDKVersionNumber,NumberFormatException in parsing Build.VERSION.SDK");
      }
    }
  }

  private static Bundle a(cls_UpdateDesc paramUpdateDesc)
  {
    Object localObject = null;
    if (paramUpdateDesc == null);
    while (true)
    {
      return localObject;
      Bundle localBundle = new Bundle();
      localBundle.putString("version", paramUpdateDesc.e());
      localBundle.putString("location", paramUpdateDesc.k());
      localBundle.putString("size", paramUpdateDesc.m());
      localBundle.putString("md5", a(paramUpdateDesc.l()));
      localBundle.putStringArrayList("function", paramUpdateDesc.o());
      localBundle.putStringArrayList("bugfix", paramUpdateDesc.p());
      localBundle.putStringArrayList("others", paramUpdateDesc.q());
      String str1 = paramUpdateDesc.d();
      String str2 = paramUpdateDesc.k();
      int i1 = str2.lastIndexOf("/");
      if (i1 > 0)
      {
        str1 = str2.substring(i1 + 1);
        int i2 = str1.lastIndexOf(".");
        if (i2 > 0)
          str1 = str1.substring(0, i2);
      }
      localBundle.putString("name", str1);
      localObject = localBundle;
    }
  }

  public static BufferedInputStream a(String paramString, long paramLong, Context paramContext)
  {
    BufferedInputStream localBufferedInputStream = null;
    if ((TextUtils.isEmpty(paramString)) || (paramLong < 0L));
    while (true)
    {
      return localBufferedInputStream;
      HttpGet localHttpGet = new HttpGet(paramString);
      if (paramLong > 0L)
      {
        localHttpGet.addHeader("RANGE", "bytes=" + paramLong + "-");
        com.nnee.g.b.e("Helper", "be about to resume-broken-download, old file size == " + paramLong);
      }
      HttpResponse localHttpResponse;
      try
      {
        localHttpResponse = a(1, null, localHttpGet, paramContext);
        if (localHttpResponse == null)
          continue;
        int i1 = localHttpResponse.getStatusLine().getStatusCode();
        if ((i1 < 200) || (i1 >= 400))
          com.nnee.g.b.d("Helper", "failed to get package at: " + paramString + ", server returned " + i1);
      }
      catch (IOException localIOException)
      {
        com.nnee.g.b.d("Helper", "getPackageContent: IOException thrown when calling getHttpResponse method");
        throw localIOException;
      }
      com.nnee.g.b.e("Helper", "http get succeeded. New package found at " + paramString);
      if ((paramLong == 0L) || ((paramLong > 0L) && (localHttpResponse.getFirstHeader("Content-Range") != null)))
      {
        InputStream localInputStream = a(localHttpResponse);
        if (localInputStream == null)
        {
          com.nnee.g.b.d("Helper", "getPackageContent: failed to get inputstream from httpresponse");
          continue;
        }
        localBufferedInputStream = new BufferedInputStream(localInputStream);
        if (paramLong <= 0L)
          continue;
        com.nnee.g.b.e("Helper", "Succeed to get data input stream when resume-broken-download");
        continue;
      }
      com.nnee.g.b.f("Helper", "server doesn't support resume-broken-download when calling getNewPackageContent()");
    }
  }

  private static InputStream a(HttpResponse paramHttpResponse)
  {
    Object localObject = null;
    if (paramHttpResponse == null);
    while (true)
    {
      return localObject;
      try
      {
        InputStream localInputStream = paramHttpResponse.getEntity().getContent();
        localObject = localInputStream;
      }
      catch (IllegalStateException localIllegalStateException)
      {
        localIllegalStateException.printStackTrace();
        com.nnee.g.b.d("Response IllegalStateException", localIllegalStateException.getMessage());
      }
      catch (IOException localIOException)
      {
        localIOException.printStackTrace();
        com.nnee.g.b.d("Response IOException", localIOException.getMessage());
      }
    }
  }

  public static String a(InputStream paramInputStream)
  {
    String str = null;
    if (paramInputStream == null);
    while (true)
    {
      return str;
      byte[] arrayOfByte = new byte[1024];
      MessageDigest localMessageDigest;
      try
      {
        localMessageDigest = MessageDigest.getInstance("MD5");
        while (true)
        {
          int i1 = paramInputStream.read(arrayOfByte, 0, 1024);
          if (i1 == -1)
            break;
          localMessageDigest.update(arrayOfByte, 0, i1);
        }
      }
      catch (Exception localException)
      {
        com.nnee.g.b.d("Helper", "get md5 failed.");
        localException.printStackTrace();
      }
      continue;
      str = new BigInteger(1, localMessageDigest.digest()).toString(16);
    }
  }

  public static String a(String paramString)
  {
    String str = null;
    if (TextUtils.isEmpty(paramString));
    while (true)
    {
      return str;
      int i1 = b(paramString);
      if ((i1 < 0) || (i1 > paramString.length()))
        continue;
      str = paramString.substring(i1);
    }
  }

  private static HttpResponse a(int paramInt, HttpPost paramHttpPost, HttpGet paramHttpGet, Context paramContext)
  {
    Object localObject1 = null;
    f();
    HttpClientParams.setRedirecting(ab.getParams(), false);
    Object localObject2;
    switch (paramInt)
    {
    default:
      localObject2 = null;
    case 0:
    case 1:
    }
    while (true)
    {
      ab = null;
      localObject1 = localObject2;
      label51: 
      do
        return localObject1;
      while (paramHttpPost == null);
      try
      {
        localObject2 = ab.execute(paramHttpPost);
        continue;
        if (paramHttpGet == null)
          break label51;
        HttpResponse localHttpResponse = ab.execute(paramHttpGet);
        localObject2 = localHttpResponse;
      }
      catch (SocketException localSocketException)
      {
        com.nnee.g.b.d("Helper", "SocketException in getHttpResponse!");
        if ((paramContext != null) && (!a(paramContext)))
          com.nnee.g.b.d("Helper", "Network is not Available now!");
        ac = 1005;
        throw localSocketException;
      }
      catch (UnknownHostException localUnknownHostException)
      {
        com.nnee.g.b.d("Helper", "UnknownHostException in getHttpResponse!");
        if ((paramContext != null) && (!a(paramContext)))
          com.nnee.g.b.d("Helper", "Network is not Available now!");
        ac = 1006;
        throw localUnknownHostException;
      }
      catch (ClientProtocolException localClientProtocolException)
      {
        com.nnee.g.b.d("Helper", "ClientProtocolException in getHttpResponse!");
        ac = 1007;
        throw localClientProtocolException;
      }
      catch (IOException localIOException)
      {
        com.nnee.g.b.d("Helper", "IOException in getHttpResponse! Exception: " + localIOException.toString());
        ac = 1008;
      }
    }
    throw localIOException;
  }

  private static void a(Context paramContext, int paramInt1, long paramLong, String paramString, int paramInt2, Bundle paramBundle)
  {
    NotificationManager localNotificationManager = (NotificationManager)paramContext.getSystemService("notification");
    Notification localNotification = new Notification(paramInt1, null, paramLong);
    localNotification.defaults = (0x1 | localNotification.defaults);
    localNotification.flags = (0x10 | localNotification.flags);
    localNotification.tickerText = paramContext.getResources().getString(paramInt2);
    Intent localIntent = new Intent();
    localIntent.setClass(paramContext, PRISActivityUpdate.class);
    localIntent.putExtras(paramBundle);
    localIntent.addFlags(75497472);
    PendingIntent localPendingIntent = PendingIntent.getActivity(paramContext, 0, localIntent, 0);
    localNotification.setLatestEventInfo(paramContext, paramContext.getText(2131361792), paramContext.getText(paramInt2), localPendingIntent);
    localNotificationManager.notify(101, localNotification);
  }

  public static void a(Context paramContext, boolean paramBoolean)
  {
    if (paramContext == null);
    while (true)
    {
      return;
      Object[] arrayOfObject = new Object[1];
      arrayOfObject[0] = "cu.123.163.com";
      HttpGet localHttpGet = new HttpGet(String.format("http://%s/au/m/update.xml", arrayOfObject));
      localHttpGet.addHeader("User-Agent", "PRIS/1.0.1 (Android/1.6Later:*/*)");
      try
      {
        a(a(1, null, localHttpGet, paramContext), paramContext, paramBoolean);
      }
      catch (SocketException localSocketException)
      {
        if (!paramBoolean)
          continue;
        Toast.makeText(paramContext, 2131362074, 0).show();
      }
      catch (UnknownHostException localUnknownHostException)
      {
        if (!paramBoolean)
          continue;
        Toast.makeText(paramContext, 2131362075, 0).show();
      }
      catch (IOException localIOException)
      {
        com.nnee.g.b.d("Helper", "IOException in checkUpdate! Exception: " + localIOException.toString());
      }
      catch (com.nnee.f.c localc)
      {
        localc.printStackTrace();
        com.nnee.g.b.d("Helper", "XMLParseException:" + localc.toString());
      }
    }
  }

  private static void a(HttpResponse paramHttpResponse, Context paramContext, boolean paramBoolean)
  {
    if ((paramHttpResponse == null) || (paramContext == null));
    while (true)
    {
      return;
      UpdateDesc localUpdateDesc;
      String str1;
      switch (paramHttpResponse.getStatusLine().getStatusCode())
      {
      case 404:
      case 604:
      default:
        break;
      case 200:
        InputStream localInputStream = a(paramHttpResponse);
        if (localInputStream == null)
          continue;
        localUpdateDesc = new UpdateDesc();
        localUpdateDesc.a(localInputStream);
        str1 = localUpdateDesc.e();
        if (str1 == null)
          continue;
      case 302:
        Bundle localBundle;
        try
        {
          String str2 = paramContext.getPackageManager().getPackageInfo(paramContext.getPackageName(), 0).versionName;
          String str3 = str2.trim();
          if (str3.contains(" "))
            str3 = str3.substring(0, str3.indexOf(" "));
          if (str3.compareToIgnoreCase(str1.trim().substring(0, str3.length())) >= 0)
            break label328;
          localBundle = a(localUpdateDesc);
          if (!paramBoolean)
            break label307;
          Intent localIntent = new Intent();
          localIntent.setClass(paramContext, PRISActivityUpdate.class);
          localIntent.putExtras(localBundle);
          localIntent.setFlags(268435456);
          paramContext.startActivity(localIntent);
          continue;
          Header[] arrayOfHeader = paramHttpResponse.getHeaders("location");
          if (arrayOfHeader.length == 0)
            continue;
          HttpGet localHttpGet = new HttpGet(arrayOfHeader[0].getValue());
          try
          {
            HttpResponse localHttpResponse = a(1, null, localHttpGet, paramContext);
            a(localHttpResponse, paramContext, paramBoolean);
          }
          catch (IOException localIOException)
          {
            localIOException.printStackTrace();
          }
        }
        catch (PackageManager.NameNotFoundException localNameNotFoundException)
        {
          localNameNotFoundException.printStackTrace();
        }
        continue;
        label307: a(paramContext, 2130837670, System.currentTimeMillis(), "update.UpdateConfirm", 2131361996, localBundle);
        continue;
        label328: if (!paramBoolean)
          continue;
        Toast.makeText(paramContext, 2131362076, 0).show();
      }
    }
  }

  public static boolean a(Context paramContext)
  {
    int i1 = 0;
    ConnectivityManager localConnectivityManager = (ConnectivityManager)paramContext.getSystemService("connectivity");
    if (localConnectivityManager == null)
      com.nnee.g.b.f("Helper", "couldn't get connectivity manager");
    label84: 
    while (true)
    {
      com.nnee.g.b.c("Helper", "network is not available");
      return i1;
      NetworkInfo[] arrayOfNetworkInfo = localConnectivityManager.getAllNetworkInfo();
      if (arrayOfNetworkInfo == null)
        continue;
      for (int i2 = 0; ; i2++)
      {
        if (i2 >= arrayOfNetworkInfo.length)
          break label84;
        if (arrayOfNetworkInfo[i2].getState() != NetworkInfo.State.CONNECTED)
          continue;
        com.nnee.g.b.c("Helper", "network is available");
        i1 = 1;
        break;
      }
    }
  }

  // ERROR //
  public static boolean a(String paramString1, String paramString2, Context paramContext)
  {
    // Byte code:
    //   0: aload_2
    //   1: ifnonnull +17 -> 18
    //   4: ldc 64
    //   6: ldc_w 625
    //   9: invokestatic 190	com/netease/g/b:d	(Ljava/lang/String;Ljava/lang/String;)V
    //   12: iconst_0
    //   13: istore 14
    //   15: iload 14
    //   17: ireturn
    //   18: aload_1
    //   19: invokestatic 246	android/text/TextUtils:isEmpty	(Ljava/lang/CharSequence;)Z
    //   22: ifne +489 -> 511
    //   25: new 124	java/lang/StringBuilder
    //   28: dup
    //   29: invokespecial 127	java/lang/StringBuilder:<init>	()V
    //   32: ldc_w 627
    //   35: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   38: aload_1
    //   39: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   42: invokevirtual 150	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   45: astore_3
    //   46: new 124	java/lang/StringBuilder
    //   49: dup
    //   50: invokespecial 127	java/lang/StringBuilder:<init>	()V
    //   53: aload_3
    //   54: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   57: ldc_w 629
    //   60: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   63: invokevirtual 150	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   66: astore 4
    //   68: invokestatic 630	com/netease/update/c:e	()Ljava/lang/String;
    //   71: astore 5
    //   73: aload 5
    //   75: invokestatic 246	android/text/TextUtils:isEmpty	(Ljava/lang/CharSequence;)Z
    //   78: ifne +48 -> 126
    //   81: new 124	java/lang/StringBuilder
    //   84: dup
    //   85: invokespecial 127	java/lang/StringBuilder:<init>	()V
    //   88: aload 4
    //   90: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   93: ldc_w 632
    //   96: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   99: invokevirtual 150	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   102: astore 22
    //   104: new 124	java/lang/StringBuilder
    //   107: dup
    //   108: invokespecial 127	java/lang/StringBuilder:<init>	()V
    //   111: aload 22
    //   113: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   116: aload 5
    //   118: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   121: invokevirtual 150	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   124: astore 4
    //   126: aload_2
    //   127: invokestatic 635	com/netease/update/c:d	(Landroid/content/Context;)Ljava/lang/String;
    //   130: astore 6
    //   132: aload 6
    //   134: invokestatic 246	android/text/TextUtils:isEmpty	(Ljava/lang/CharSequence;)Z
    //   137: ifne +48 -> 185
    //   140: new 124	java/lang/StringBuilder
    //   143: dup
    //   144: invokespecial 127	java/lang/StringBuilder:<init>	()V
    //   147: aload 4
    //   149: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   152: ldc_w 637
    //   155: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   158: invokevirtual 150	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   161: astore 21
    //   163: new 124	java/lang/StringBuilder
    //   166: dup
    //   167: invokespecial 127	java/lang/StringBuilder:<init>	()V
    //   170: aload 21
    //   172: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   175: aload 6
    //   177: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   180: invokevirtual 150	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   183: astore 4
    //   185: aload_2
    //   186: invokestatic 639	com/netease/update/c:c	(Landroid/content/Context;)Ljava/lang/String;
    //   189: astore 7
    //   191: aload 7
    //   193: invokestatic 246	android/text/TextUtils:isEmpty	(Ljava/lang/CharSequence;)Z
    //   196: ifne +48 -> 244
    //   199: new 124	java/lang/StringBuilder
    //   202: dup
    //   203: invokespecial 127	java/lang/StringBuilder:<init>	()V
    //   206: aload 4
    //   208: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   211: ldc_w 641
    //   214: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   217: invokevirtual 150	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   220: astore 20
    //   222: new 124	java/lang/StringBuilder
    //   225: dup
    //   226: invokespecial 127	java/lang/StringBuilder:<init>	()V
    //   229: aload 20
    //   231: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   234: aload 7
    //   236: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   239: invokevirtual 150	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   242: astore 4
    //   244: invokestatic 645	com/netease/pris/b/a:c	()Ljava/lang/String;
    //   247: astore 8
    //   249: aload 8
    //   251: invokestatic 246	android/text/TextUtils:isEmpty	(Ljava/lang/CharSequence;)Z
    //   254: ifne +48 -> 302
    //   257: new 124	java/lang/StringBuilder
    //   260: dup
    //   261: invokespecial 127	java/lang/StringBuilder:<init>	()V
    //   264: aload 4
    //   266: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   269: ldc_w 647
    //   272: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   275: invokevirtual 150	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   278: astore 19
    //   280: new 124	java/lang/StringBuilder
    //   283: dup
    //   284: invokespecial 127	java/lang/StringBuilder:<init>	()V
    //   287: aload 19
    //   289: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   292: aload 8
    //   294: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   297: invokevirtual 150	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   300: astore 4
    //   302: invokestatic 648	com/netease/update/c:c	()Ljava/lang/String;
    //   305: astore 9
    //   307: aload 9
    //   309: invokestatic 246	android/text/TextUtils:isEmpty	(Ljava/lang/CharSequence;)Z
    //   312: ifne +48 -> 360
    //   315: new 124	java/lang/StringBuilder
    //   318: dup
    //   319: invokespecial 127	java/lang/StringBuilder:<init>	()V
    //   322: aload 4
    //   324: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   327: ldc_w 650
    //   330: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   333: invokevirtual 150	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   336: astore 18
    //   338: new 124	java/lang/StringBuilder
    //   341: dup
    //   342: invokespecial 127	java/lang/StringBuilder:<init>	()V
    //   345: aload 18
    //   347: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   350: aload 9
    //   352: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   355: invokevirtual 150	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   358: astore 4
    //   360: getstatic 162	com/netease/update/c:u	Ljava/lang/String;
    //   363: invokestatic 246	android/text/TextUtils:isEmpty	(Ljava/lang/CharSequence;)Z
    //   366: ifne +49 -> 415
    //   369: new 124	java/lang/StringBuilder
    //   372: dup
    //   373: invokespecial 127	java/lang/StringBuilder:<init>	()V
    //   376: aload 4
    //   378: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   381: ldc_w 652
    //   384: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   387: invokevirtual 150	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   390: astore 17
    //   392: new 124	java/lang/StringBuilder
    //   395: dup
    //   396: invokespecial 127	java/lang/StringBuilder:<init>	()V
    //   399: aload 17
    //   401: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   404: getstatic 162	com/netease/update/c:u	Ljava/lang/String;
    //   407: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   410: invokevirtual 150	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   413: astore 4
    //   415: new 124	java/lang/StringBuilder
    //   418: dup
    //   419: invokespecial 127	java/lang/StringBuilder:<init>	()V
    //   422: aload 4
    //   424: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   427: ldc_w 654
    //   430: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   433: invokevirtual 150	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   436: astore 10
    //   438: new 124	java/lang/StringBuilder
    //   441: dup
    //   442: invokespecial 127	java/lang/StringBuilder:<init>	()V
    //   445: aload 10
    //   447: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   450: aload_0
    //   451: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   454: invokevirtual 150	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   457: astore 11
    //   459: ldc 64
    //   461: new 124	java/lang/StringBuilder
    //   464: dup
    //   465: invokespecial 127	java/lang/StringBuilder:<init>	()V
    //   468: ldc_w 656
    //   471: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   474: aload 11
    //   476: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   479: invokevirtual 150	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   482: invokestatic 267	com/netease/g/b:e	(Ljava/lang/String;Ljava/lang/String;)V
    //   485: new 248	org/apache/http/client/methods/HttpGet
    //   488: dup
    //   489: aload 11
    //   491: invokespecial 251	org/apache/http/client/methods/HttpGet:<init>	(Ljava/lang/String;)V
    //   494: astore 12
    //   496: iconst_1
    //   497: aconst_null
    //   498: aload 12
    //   500: aload_2
    //   501: invokestatic 270	com/netease/update/c:a	(ILorg/apache/http/client/methods/HttpPost;Lorg/apache/http/client/methods/HttpGet;Landroid/content/Context;)Lorg/apache/http/HttpResponse;
    //   504: pop
    //   505: iconst_1
    //   506: istore 14
    //   508: goto -493 -> 15
    //   511: new 124	java/lang/StringBuilder
    //   514: dup
    //   515: invokespecial 127	java/lang/StringBuilder:<init>	()V
    //   518: ldc_w 627
    //   521: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   524: ldc 108
    //   526: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   529: invokevirtual 150	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   532: astore_3
    //   533: goto -487 -> 46
    //   536: astore 16
    //   538: ldc 64
    //   540: new 124	java/lang/StringBuilder
    //   543: dup
    //   544: invokespecial 127	java/lang/StringBuilder:<init>	()V
    //   547: ldc_w 658
    //   550: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   553: aload 11
    //   555: invokevirtual 143	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   558: invokevirtual 150	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   561: invokestatic 190	com/netease/g/b:d	(Ljava/lang/String;Ljava/lang/String;)V
    //   564: iconst_0
    //   565: istore 14
    //   567: goto -552 -> 15
    //   570: astore 13
    //   572: ldc 64
    //   574: ldc_w 660
    //   577: invokestatic 190	com/netease/g/b:d	(Ljava/lang/String;Ljava/lang/String;)V
    //   580: goto -75 -> 505
    //
    // Exception table:
    //   from	to	target	type
    //   485	496	536	java/lang/IllegalArgumentException
    //   496	505	570	java/io/IOException
  }

  private static int b(String paramString)
  {
    int i1;
    if (TextUtils.isEmpty(paramString))
      i1 = -1;
    while (true)
    {
      return i1;
      for (i1 = 0; ; i1++)
      {
        if (i1 >= paramString.length())
          break label38;
        if (paramString.charAt(i1) != '0')
          break;
      }
      label38: i1 = -1;
    }
  }

  public static String b()
  {
    return new String(Build.VERSION.RELEASE);
  }

  private static String b(Context paramContext)
  {
    String str;
    if (paramContext == null)
    {
      com.nnee.g.b.f("Helper", "invalid input when calling getPhoneImei()");
      str = "";
    }
    while (true)
    {
      return str;
      TelephonyManager localTelephonyManager = (TelephonyManager)paramContext.getSystemService("phone");
      if (localTelephonyManager != null)
      {
        str = localTelephonyManager.getLine1Number();
        continue;
      }
      str = null;
    }
  }

  public static String c()
  {
    if (v == null)
      v = d();
    return v;
  }

  private static String c(Context paramContext)
  {
    String str;
    if (paramContext == null)
    {
      com.nnee.g.b.f("Helper", "invalid input when calling getPhoneImei()");
      str = "";
    }
    while (true)
    {
      return str;
      TelephonyManager localTelephonyManager = (TelephonyManager)paramContext.getSystemService("phone");
      if (localTelephonyManager != null)
      {
        str = localTelephonyManager.getDeviceId();
        continue;
      }
      str = null;
    }
  }

  public static String d()
  {
    return "Android";
  }

  private static String d(Context paramContext)
  {
    String str;
    if (paramContext == null)
    {
      com.nnee.g.b.f("Helper", "invalid input when calling getClientVersion()");
      str = "";
    }
    while (true)
    {
      return str;
      str = "";
      try
      {
        str = paramContext.getPackageManager().getPackageInfo(paramContext.getPackageName(), 0).versionName;
        if (TextUtils.isEmpty(str))
          continue;
        int i1 = str.indexOf(" ");
        if (i1 <= 0)
          continue;
        str = str.substring(0, i1);
      }
      catch (PackageManager.NameNotFoundException localNameNotFoundException)
      {
        while (true)
          com.nnee.g.b.f("Helper", "failed to get the rpmms version");
      }
    }
  }

  private static String e()
  {
    String str1 = Build.MODEL;
    if (!TextUtils.isEmpty(str1));
    while (true)
    {
      try
      {
        str1 = URLEncoder.encode(str1, "UTF-8");
        String str3 = str1.replaceAll("\\+", "%20");
        str2 = str3;
        return str2;
      }
      catch (UnsupportedEncodingException localUnsupportedEncodingException)
      {
        com.nnee.g.b.d("Helper", "Failed to encode to scheme UTF-8: " + str1);
        str2 = "";
        continue;
      }
      catch (PatternSyntaxException localPatternSyntaxException)
      {
        com.nnee.g.b.d("Helper", "Failed to replace all '+' with %20: " + str1);
        str2 = "";
        continue;
      }
      String str2 = "";
    }
  }

  private static void f()
  {
    if (ab == null)
    {
      BasicHttpParams localBasicHttpParams = new BasicHttpParams();
      HttpConnectionParams.setConnectionTimeout(localBasicHttpParams, 20000);
      HttpConnectionParams.setSoTimeout(localBasicHttpParams, 20000);
      HttpConnectionParams.setSocketBufferSize(localBasicHttpParams, 8192);
      HttpProtocolParams.setUseExpectContinue(localBasicHttpParams, true);
      SchemeRegistry localSchemeRegistry = new SchemeRegistry();
      localSchemeRegistry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
      ab = new DefaultHttpClient(new ThreadSafeClientConnManager(localBasicHttpParams, localSchemeRegistry), localBasicHttpParams);
      ab.getParams().setParameter("http.protocol.cookie-policy", "best-match");
      d locald = com.nnee.e.b.a(PrisApp.a()).c();
      if ((locald != null) && (!i.e(locald.d)))
      {
        HttpHost localHttpHost = new HttpHost(locald.d, locald.c);
        ab.getParams().setParameter("http.route.default-proxy", localHttpHost);
      }
    }
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.nnee.update.c
 * JD-Core Version:    0.6.0
 */